#include <sys_head.h>

int main(int argc, char const *argv[])
{
    key_t key = ftok("home/student/桌面",1);
    int id = shmget(key,128,IPC_CREAT|0666);
    void *p = shmat(id,NULL,0);
    //strcpy(p,"helloworld!");
    int arr[] = {1,2,3,4,5,6,7,8,9,10};
    int *pInt = (int *)p;
    for (int i = 0; i < 10; i++)
    {
        pInt[i] = arr[i];
    }
    
    shmdt(p);
    //shmctl(id,IPC_RMID,NULL);
    return 0;
}
